<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="x">
    <input type="text" name="" id="y">
    <button id="btn">得数</button>
    <input type="text" name="" id="ds">
    <script>
        document.getElementById("btn").onclick = function() {
            var _x = Number(document.getElementById("x").value);
            var _y = Number(document.getElementById("y").value);
            var s = 1;
            for (i = 1; i <= _y; i++) {
                s *= _x;
            }
            document.getElementById("ds").value = s;
        }
    </script>
</body>

</html>